package com.ruoyi.system.mapper;

import java.util.List;
import com.ruoyi.system.domain.survey.SurveyAnswer;

/**
 * 答卷Mapper接口
 * 
 */
public interface SurveyAnswerMapper 
{
    /**
     * 查询答卷
     * 
     * @param answerId 答卷ID
     * @return 答卷
     */
    public SurveyAnswer selectSurveyAnswerById(Long answerId);

    /**
     * 查询答卷列表
     * 
     * @param surveyAnswer 答卷
     * @return 答卷集合
     */
    public List<SurveyAnswer> selectSurveyAnswerList(SurveyAnswer surveyAnswer);
    
    /**
     * 根据问卷ID查询答卷列表
     * 
     * @param surveyId 问卷ID
     * @return 答卷集合
     */
    public List<SurveyAnswer> selectSurveyAnswerBySurveyId(Long surveyId);
    
    /**
     * 根据问卷ID和用户ID查询答卷
     * 
     * @param surveyId 问卷ID
     * @param userId 用户ID
     * @return 答卷
     */
    public SurveyAnswer selectSurveyAnswerByUserIdAndSurveyId(Long surveyId, Long userId);

    /**
     * 新增答卷
     * 
     * @param surveyAnswer 答卷
     * @return 结果
     */
    public int insertSurveyAnswer(SurveyAnswer surveyAnswer);

    /**
     * 修改答卷
     * 
     * @param surveyAnswer 答卷
     * @return 结果
     */
    public int updateSurveyAnswer(SurveyAnswer surveyAnswer);

    /**
     * 删除答卷
     * 
     * @param answerId 答卷ID
     * @return 结果
     */
    public int deleteSurveyAnswerById(Long answerId);

    /**
     * 批量删除答卷
     * 
     * @param answerIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteSurveyAnswerByIds(Long[] answerIds);
    
    /**
     * 根据问卷ID删除答卷
     * 
     * @param surveyId 问卷ID
     * @return 结果
     */
    public int deleteSurveyAnswerBySurveyId(Long surveyId);
    
    /**
     * 统计问卷答卷数量
     * 
     * @param surveyId 问卷ID
     * @return 结果
     */
    public int countSurveyAnswerBySurveyId(Long surveyId);
} 